<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h2 id="title"></h2>
    <h3>发布时间：<span id="time">
    </span></h3>
    <hr>
    <div id="content">

    </div>
    <script src="jquery.min.js"></script>
    <script>
        String.prototype.parseUrl = function() {
            let arr = this.slice(this.indexOf("?") + 1).split("&")
            let result = {}
            arr.forEach(item => {
                let key = item.split("=")[0]
                let value = item.split("=")[1]
                result[key] = value
            })
            return result;
        }
        $.ajax({
            url: "http://10.35.170.82:8080/getnews",
            data: {
                id: location.href.parseUrl().id
            },
            success(data) {
                $("#title").html(data.title)
                $("#time").html(data.time)
                $("#content").html(data.content)
                $("#content").html(data.src)
                console.log(data)
            }
        })
    </script>
</body>

</html>